import 'package:flustars_flutter3/flustars_flutter3.dart';
import 'package:flutter/material.dart';
import 'package:flutter_deer/account/models/account_summary_entity.dart';
import 'package:flutter_deer/res/constant.dart';
import 'package:flutter_deer/widgets/state_layout.dart';

class AccountSummaryProvider extends ChangeNotifier {

  StateType? _stateType = StateType.loading;
  StateType? get stateType => _stateType;
  AccountSummaryEntity? _accountSummary;
  AccountSummaryEntity? get accountSummary => _accountSummary;
  bool? _existWithdrawPassword = false;
  bool? get existWithdrawPassword => _existWithdrawPassword;
  StateType? _existWithdrawPasswordState = StateType.loading;
  StateType? get existWithdrawPasswordState => _existWithdrawPasswordState;

  void setAccountSummary(AccountSummaryEntity? entity){
    _accountSummary = entity;
    _stateType = StateType.empty;
    notifyListeners();
  }

  void setExistWithdrawPassword(bool? result){
    _existWithdrawPassword = result;
    _existWithdrawPasswordState = StateType.empty;
    SpUtil.putBool(Constant.existWithdralPassword, result!);
    notifyListeners();
  }
}
